
*Author: Zhenqian Huang and Xun Cao 
*Project: The Lure of Technocracy? Chinese Aid and Local Preferences for Development Leadership in Africa
*Journal: Foreign Policy Analysis
*Date Last Modified: November 6, 2022 
*Email: zhenqianh@cau.edu.cn (for the questions of codes and datasets)



*************************************************************************************************************************************************************
********************************************************FIGURES AND TABLES FROM THE PAPER PAERT ONE: Main Text ********************************************************************
*************************************************************************************************************************************************************



*Figure 1:  Chinese aid to Africa, 2000-2017 
*******************************************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid to africa 1956 2017.dta",clear

line aid_year year if year>=2000,sort // the figure has been edited in Stata 


*Figure 2:  Chinese aid projects, clusters from the second round (R2) of Afrobarometer surveys, and countries included, 2000-2005
*******************************************************************************************************
*not made in Stata, made in QGIS, not shown here.



*Figure 3: Aid projects before and after the Afroborameter survey, 20km-radius buffers around them, and culsters of respondents from the survey in Kenya
*******************************************************************************************************
*not made in Stata, made in QGIS, not shown here.





***FIGURE 4: Marginal effects of Chinese aid on the preference of experts to run economy using different distance thresholds. 
***********************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear

***Define active* and inactive* by 20km, 30km, 40km, and 50km. Already difined in the dataset.

//20km as an example  
*These varibales aleady defined in the dataset, please run the regressions and plot the figure directly  

gen active20=.
replace active20=1 if pre_dis <= 20
replace active20=0 if active20!=1

gen inactive20=.
replace inactive20=1 if post_dis <= 20 & active20!=1
replace inactive20=0 if inactive20!=1

replace inactive20=0 if active20==1 // make sure same points do not be treated twice 


gen sum_activeinactive20 = active20+inactive20 	
gen sum_activeinactive30 = active30+inactive30 	
gen sum_activeinactive40 = active40+inactive40 	
gen sum_activeinactive50 = active50+inactive50 

gen diffhelp20 = active20
gen diffhelp30 = active30
gen diffhelp40 = active40
gen diffhelp50 = active50

gen helpvar20 = diffhelp20						
	label var helpvar20 "20 km"
gen helpvar30 = diffhelp30						
	label var helpvar30 "30 km"
gen helpvar40 = diffhelp40						
	label var helpvar40 "40 km"
gen helpvar50 = diffhelp50						
	label var helpvar50 "50 km"
	
***Please run the regressions before plotting of the figure, the figure has beeen edited in Stata

*20
reg experts_dummy sum_activeinactive20 helpvar20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e20
*30
reg experts_dummy sum_activeinactive30 helpvar30 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e30
*40
reg experts_dummy sum_activeinactive40 helpvar40 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e40
*50
reg experts_dummy sum_activeinactive50 helpvar50 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e50

ssc install blindschemes
set scheme  plottig

ssc install coefplot, replace 
coefplot e20 e30 e40 e50 ///
, nooffsets keep(helpvar*) xline(0)  xtitle(Difference) levels(95) msymbol(circle) msize(V small) mcolor(black) lcolor(black)  mfcolor(black) ciopts(recast(rcap))



***FIGURE 5: Marginal effects of World Bank aid on the preference of experts to run economy using different distance thresholds. 
***********************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/World Bank aid sample_1.dta",clear

*These varibales aleady defined in the dataset, please run the regressions and plot the figure directly  

gen sum_activeinactive20 = active20+inactive20 	
gen sum_activeinactive30 = active30+inactive30 	
gen sum_activeinactive40 = active40+inactive40 	
gen sum_activeinactive50 = active50+inactive50 

gen diffhelp20 = active20
gen diffhelp30 = active30
gen diffhelp40 = active40
gen diffhelp50 = active50

gen helpvar20 = diffhelp20						
	label var helpvar20 "20 km"
gen helpvar30 = diffhelp30						
	label var helpvar30 "30 km"
gen helpvar40 = diffhelp40						
	label var helpvar40 "40 km"
gen helpvar50 = diffhelp50						
	label var helpvar50 "50 km"
	
	
***Please run the regressions before plotting of the figure, the figure has beeen edited in Stata

*20
reg experts_dummy sum_activeinactive20 helpvar20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e20
*30
reg experts_dummy sum_activeinactive30 helpvar30 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e30
*40
reg experts_dummy sum_activeinactive40 helpvar40 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e40
*50
reg experts_dummy sum_activeinactive50 helpvar50 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e50
	
***Plot figure of 20km, 30km,40km, and 50 km. Edited the figure in Stata.

set scheme  plottig

coefplot e20 e30 e40 e50 ///
, nooffsets keep(helpvar*) xline(0)  xtitle(Difference) levels(95) msymbol(circle) msize(V small) mcolor(black) lcolor(black)  mfcolor(black) ciopts(recast(rcap))


*************************************************************Table 1: The distribution of aid projects across country and over time
*not made in Stata, manually calculated by the authors.



*************************************************************Table 2: The distribution of aid projects across country and over time
*not made in Stata, manually calculated by the authors.




*************************************************************Table 3: Main results on the effects of Chinese aid
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear

****Panel A: ordered logit regressions	
ssc install outreg2

ologit government active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

ologit market active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 2)

ologit experts active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 3)

ologit rich active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 4)

ologit natural active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 5)


test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
 

***Panel B: logistic regressions	

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
	
test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
	

*************************************************************Table 4: World Bank aid results.
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/World Bank aid sample_1.dta",clear

****Panel A: ordered logit regressions	

ologit government active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

ologit market active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 2)

ologit experts active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 3)

ologit rich active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 4)

ologit natural active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc,  append ctitle (model 5)


test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
 

***Panel B: logistic regressions	

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
	
test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 



		
*************************************************************************************************************************************************************
********************************************************FIGURES AND TABLES FROM THE PAPER: Online Appendix********************************************************************
*************************************************************************************************************************************************************


*************************************************************Table B.1b: Descriptive statistics 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear


outreg2 using /Users/huangzhenqian/myreg.doc, replace sum(log) keep(goverment_dummy government market_dummy market  experts_dummy experts rich_dummy rich rich_dummy rich natural_dummy natural active20 inactive20 age gender urban education bdist3 capdist excluded nlights_calib_mean oil diamond gold) 


*************************************************************Table B.2: The distribution of observations within 20km (active20/inactive20) and 30km (active30/inactive30
*not made in Stata, manually calculated by the authors.



*************************************************************Table B.3: Balance in Covariates. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_balance.dta",clear
*gen treat=1 if active20==1
*replace treat=0 if inactive20==1
*Obtain observations and means of the treated and untreated 

outreg2 using /Users/huangzhenqian/myreg.doc, replace sum(log), if treat==1 

outreg2 using /Users/huangzhenqian/myreg.doc, replace sum(log), if treat==0

*Using the following estimations to obtain coeffiencts and P-value in Table B.3 
*No observations of oil. 

reg age treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

reg gender treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 1)

reg education treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

reg urban treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

reg capdist treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

reg bdist3 treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

reg nlights_calib_mean treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 6)

reg excluded treat i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 7)

reg oil treat i.region i.year i.region#i.year,vce(cluster geome_id) 
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 8)

reg diamond treat i.region i.year i.region#i.year,vce(cluster geome_id) 
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 8)

reg gold treat i.region i.year i.region#i.year,vce(cluster geome_id) 
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 9)


*************************************************************Table B.4: Main results (showing all variables)
*Same as Table 3.

*************************************************************Table B.5: Region-year pair fixed effects model. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear

logit goverment_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year i.region#i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*************************************************************Table B.6: OLS estimation of Chinese aid. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2.dta",clear 

reg goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

reg market_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

reg experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

reg rich_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

reg natural_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*************************************************************Table B.7: effects after controlling for spatial autocorrelation.
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_sa.dta",clear

** Please install "acreg" package in Stata first. 
*drop if latitude == . | longitude == ., already defined in the dataset. 

*Panel A: 50 km as a cutoff distance 
acreg goverment_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(50) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

acreg market_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(50) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

acreg experts_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(50) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

acreg rich_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(50) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

acreg natural_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(50) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)


test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 

*Panel B: 100 km as a cutoff distance 
acreg goverment_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(100) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

acreg market_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(100) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

acreg experts_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(100) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

acreg rich_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(100) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

acreg natural_dummy active20 inactive20 age gender education urban  capdist bdist3 nlights_calib_mean excluded oil diamond gold, spatial latitude(latitude) longitude(longitude) dist(100) id(region) time(year) pfe1(region)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 



*************************************************************Table B.8: Logistic regression results using other cut-off distances. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear


*Panel A: 30 km cutoff

logit goverment_dummy active30 inactive30 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active30 inactive30  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active30 inactive30 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active30 inactive30  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active30 inactive30  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
test active30 - inactive30 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*Panel B: 40 km cutoff


logit goverment_dummy active40 inactive40 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active40 inactive40  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active40 inactive40 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active40 inactive40  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active40 inactive40  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	

test active40 - inactive40 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
	
*Panel C: 50 km cutoff

logit goverment_dummy active50 inactive50 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active50 inactive50  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active50 inactive50 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active50 inactive50  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active50 inactive50  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
test active50 - inactive50 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
	
	
*************************************************************Table B.9: World Bank aid projects were absent from 1995-1999: Chinese aid.
*******************************************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_pre.dta",clear

*dis_pre2000 measures the nearest distance (km) of respondents to World Bank (WB) projects that present before 2000 
*pre2000_25 coded as 0 if there was a WB project within 25km before 2000, coded as 1 otherwise 
*pre2000_50 coded as 0 if there was a WB project within 50km before 2000, coded as 1 otherwise 


*Panel A: World Bank aid sites were absent from 1995-1999 within 25 km

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*Panel B: World Bank aid sites were absent from 1995-1999 within 50 km

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 



*************************************************************Table B.10: World Bank aid projects were absent from 1995-1999: World Bank aid.
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/World Bank aid sample_pre.dta",clear 


*Panel A: World Bank aid sites were absent from 1995-1999 within 25 km

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_25==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*Panel B: World Bank aid sites were absent from 1995-1999 within 50 km

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if pre2000_50==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 



*************************************************************Table B.11: Results after Dropping Malawi and South Africa. 
*******************************************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear

* Malawi country number is 4 and South Africa country number is 8
*gen ms=0
*replace ms= 1 if country==4
*replace ms= 1 if country==8


logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year if ms==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if ms==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if ms==0 ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year if ms==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if ms==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
	
test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
	

*************************************************************Table B.12: Results using surveys up to 2006. 
*******************************************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2006.dta",clear  

***Notes: The bottom four rows results of Table B.12 have been mistakenly reported (caused by manually copying and pasting) while our findings remain. Please use the replicate files as the final results.

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
	
test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
	

*************************************************************Table B.13: Determinants of local Chinese aid projects, 2000-2005.
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_determinants.dta",clear 

* candidate coded as 1 if there is at least one aid targeted the grid during 2000 to 2005, otherwise coded as 0.
* candi_2000 equals 1 indicates that there is at least one aid project in the grid in that year, otherwise coded as 0.
**Notes: the coefficients are same as Table B.13, significant levels varies in a few variables when using replication data. 

logit candidate bdist3 capdist excluded nlights_calib_mean  urban_index gold oil diamond  i.ccode i.year,r
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit candi_2000 bdist3 capdist excluded  nlights_calib_mean   urban_index gold oil diamond i.ccode if year==2000,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 1)

logit candi_2001 bdist3 capdist excluded  nlights_calib_mean   urban_index gold oil diamond i.ccode if year==2001
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit candi_2002 bdist3 capdist excluded  nlights_calib_mean  urban_index gold oil diamond i.ccode if year==2002,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit candi_2003 bdist3 capdist excluded  nlights_calib_mean   urban_index gold oil diamond  i.ccode if year==2003,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit candi_2004 bdist3 capdist excluded  nlights_calib_mean   urban_index gold oil diamond i.ccode if year==2004,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

logit candi_2005 bdist3 capdist excluded  nlights_calib_mean   urban_index gold oil diamond i.ccode if year==2005,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 6)


*************************************************************Table B.14: Relations between China’s aid and FDI in Africa
*******************************************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_fdi.dta", clear

*gen a variable r2: coded as 1 Round 2 suverys covered the country, otherwise as 0.

 
reg logaid logfdi polity logland_area logpopulation resource gdpper i.year i.ccode,r
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)


reg logaid logfdi  polity logland_area logpopulation resource gdpper i.year i.ccode if r2==1,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)


reg logaid logfdi  polity logland_area logpopulation resource gdpper i.year i.ccode if year<=2005,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

reg logaid logfdi  polity logland_area logpopulation resource gdpper i.year i.ccode if r2==1 & year<=2005,r
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)


*************************************************************Table B.15: Excluding reference group. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2.dta", clear


logit goverment_dummy active20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if active20==1|inactive20==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if active20==1|inactive20==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if active20==1|inactive20==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if active20==1|inactive20==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20  age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if active20==1|inactive20==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)
 


*************************************************************Table B.16: Removing control variables. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear


logit goverment_dummy active20 inactive20 i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20  i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20  i.region  i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20  i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)	
	
test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 
	

*************************************************************Table B.17: Control aid volume. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2.dta", clear

logit goverment_dummy active20 inactive20 age gender education urban amount_usd  capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban amount_usd   capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban amount_usd   capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban amount_usd   capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban amount_usd   capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*************************************************************Table B.18: Control aid implementation time. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2.dta", clear

logit goverment_dummy active20 inactive20 age gender education urban   days capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban   days capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban   days capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban   days capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban   days capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 

*************************************************************Table B.19: Control technical complexity projects
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2.dta", clear

logit goverment_dummy active20 inactive20 age gender education urban tec capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban tec capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban tec capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban tec capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban tec capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year ,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*************************************************************Table B.20: Hard sector results. 
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_2.dta", clear

//Panel A: Hard sector of Chinese aid
logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 

//Panel B: Hard sector of World Bank aid
use "/Users/huangzhenqian/Desktop/Replication data/World Bank aid sample_hard.dta",clear 

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if hard_sector==1,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*************************************************************Table B.21: Logistic regression results after removing aid projects that started the same year when a survey was conducted.
*******************************************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear

* a variable of sameyear was created if aid projects started in same the year coded as 1, 0 otherwise

logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if sameyear==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if sameyear==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if sameyear==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if sameyear==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if sameyear==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 


*************************************************************Table B.22: Logistic regression results only using countries with aid projects both before and after a survey.
*******************************************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_1.dta",clear

*Excluding country: Cape Verde (13), Malawi (4), Mali (5), Senegal(16), South Africa(8)
*gen bf=0
*replace bf=1 if country == 13
*replace bf=1 if country == 4
*replace bf=1 if country == 5
*replace bf=1 if country == 16
*replace bf=1 if country == 8


logit goverment_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if bf==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, replace ctitle (model 1)

logit market_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if bf==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 2)

logit experts_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if bf==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 3)

logit rich_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if bf==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 4)

logit natural_dummy active20 inactive20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year if bf==0,vce(cluster geome_id)
outreg2 using /Users/huangzhenqian/myreg.doc, append ctitle (model 5)

test active20 - inactive20 = 0 // execute the command after each regression to conduct T-test. The values of difference in difference in the table obtained manually. 





***FIGURE C.1: Figure C.1: Estimated Effects of Chinese aid from 20 km to 50 km. 
***********************************************************************************
use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid sample_plot.dta",clear

*** Generate different distances
*These varibales aleady defined in the dataset, please run the regressions and plot the figure directly  

//20
gen active20=.
replace active20=1 if pre_dis <= 20
replace active20=0 if active20!=1

gen inactive20=.
replace inactive20=1 if post_dis <= 20 & active20!=1
replace inactive20=0 if inactive20!=1

replace inactive20=0 if active20==1 // make sure same points do not be treated twice 

//21
gen active21=.
replace active21=1 if pre_dis <= 21
replace active21=0 if active21!=1

gen inactive21=.
replace inactive21=1 if post_dis <= 21 & active21!=1
replace inactive21=0 if inactive21!=1

replace inactive21=0 if active21==1  


//22
gen active22=.
replace active22=1 if pre_dis <= 22
replace active22=0 if active22!=1

gen inactive22=.
replace inactive22=1 if post_dis <= 22 & active22!=1
replace inactive22=0 if inactive22!=1

replace inactive22=0 if active22==1 

//23
gen active23=.
replace active23=1 if pre_dis <= 23
replace active23=0 if active23!=1

gen inactive23=.
replace inactive23=1 if post_dis <= 23 & active23!=1
replace inactive23=0 if inactive23!=1

replace inactive23=0 if active23==1 

//24
gen active24=.
replace active24=1 if pre_dis <= 24
replace active24=0 if active24!=1

gen inactive24=.
replace inactive24=1 if post_dis <= 24 & active24!=1
replace inactive24=0 if inactive24!=1

replace inactive24=0 if active24==1 


//25
gen active25=.
replace active25=1 if pre_dis <= 25
replace active25=0 if active25!=1

gen inactive25=.
replace inactive25=1 if post_dis <= 25 & active25!=1
replace inactive25=0 if inactive25!=1

replace inactive25=0 if active25==1 

//26
gen active26=.
replace active26=1 if pre_dis <= 26
replace active26=0 if active26!=1

gen inactive26=.
replace inactive26=1 if post_dis <= 26 & active26!=1
replace inactive26=0 if inactive26!=1

replace inactive26=0 if active26==1  

//27
gen active27=.
replace active27=1 if pre_dis <= 27
replace active27=0 if active27!=1

gen inactive27=.
replace inactive27=1 if post_dis <= 27 & active27!=1
replace inactive27=0 if inactive27!=1

replace inactive27=0 if active27==1 

//28
gen active28=.
replace active28=1 if pre_dis <= 28
replace active28=0 if active28!=1

gen inactive28=.
replace inactive28=1 if post_dis <= 28 & active28!=1
replace inactive28=0 if inactive28!=1

replace inactive28=0 if active28==1 

//29
gen active29=.
replace active29=1 if pre_dis <= 29
replace active29=0 if active29!=1

gen inactive29=.
replace inactive29=1 if post_dis <= 29 & active29!=1
replace inactive29=0 if inactive29!=1

replace inactive29=0 if active29==1 

//30
gen active30=.
replace active30=1 if pre_dis <= 30
replace active30=0 if active30!=1

gen inactive30=.
replace inactive30=1 if post_dis <= 30 & active30!=1
replace inactive30=0 if inactive30!=1

replace inactive30=0 if active30==1 

//31
gen active31=.
replace active31=1 if pre_dis <= 31
replace active31=0 if active31!=1

gen inactive31=.
replace inactive31=1 if post_dis <= 31 & active31!=1
replace inactive31=0 if inactive31!=1

replace inactive31=0 if active31==1 

//32
gen active32=.
replace active32=1 if pre_dis <= 32
replace active32=0 if active32!=1

gen inactive32=.
replace inactive32=1 if post_dis <= 32 & active32!=1
replace inactive32=0 if inactive32!=1

replace inactive32=0 if active32==1 

//33
gen active33=.
replace active33=1 if pre_dis <= 33
replace active33=0 if active33!=1

gen inactive33=.
replace inactive33=1 if post_dis <= 33 & active33!=1
replace inactive33=0 if inactive33!=1

replace inactive33=0 if active33==1  

//34
gen active34=.
replace active34=1 if pre_dis <= 34
replace active34=0 if active34!=1

gen inactive34=.
replace inactive34=1 if post_dis <= 34 & active34!=1
replace inactive34=0 if inactive34!=1

replace inactive34=0 if active34==1 

//35
gen active35=.
replace active35=1 if pre_dis <= 35
replace active35=0 if active35!=1

gen inactive35=.
replace inactive35=1 if post_dis <= 35 & active35!=1
replace inactive35=0 if inactive35!=1

replace inactive35=0 if active35==1 

//36
gen active36=.
replace active36=1 if pre_dis <= 36
replace active36=0 if active36!=1

gen inactive36=.
replace inactive36=1 if post_dis <= 36 & active36!=1
replace inactive36=0 if inactive36!=1

replace inactive36=0 if active36==1  

//37

gen active37=.
replace active37=1 if pre_dis <= 37
replace active37=0 if active37!=1

gen inactive37=.
replace inactive37=1 if post_dis <= 37 & active37!=1
replace inactive37=0 if inactive37!=1

replace inactive37=0 if active37==1  

//38
gen active38=.
replace active38=1 if pre_dis <= 38
replace active38=0 if active38!=1

gen inactive38=.
replace inactive38=1 if post_dis <= 38 & active38!=1
replace inactive38=0 if inactive38!=1

replace inactive38=0 if active38==1 

//39
gen active39=.
replace active39=1 if pre_dis <= 39
replace active39=0 if active39!=1

gen inactive39=.
replace inactive39=1 if post_dis <= 39 & active39!=1
replace inactive39=0 if inactive39!=1

replace inactive39=0 if active39==1  

//40
gen active40=.
replace active40=1 if pre_dis <= 40
replace active40=0 if active40!=1

gen inactive40=.
replace inactive40=1 if post_dis <= 40 & active40!=1
replace inactive40=0 if inactive40!=1

replace inactive40=0 if active40==1 

//41

gen active41=.
replace active41=1 if pre_dis <= 41
replace active41=0 if active41!=1

gen inactive41=.
replace inactive41=1 if post_dis <= 41 & active41!=1
replace inactive41=0 if inactive41!=1

replace inactive41=0 if active41==1

//42
gen active42=.
replace active42=1 if pre_dis <= 42
replace active42=0 if active42!=1

gen inactive42=.
replace inactive42=1 if post_dis <= 42 & active42!=1
replace inactive42=0 if inactive42!=1

replace inactive42=0 if active42==1  

//43
gen active43=.
replace active43=1 if pre_dis <= 43
replace active43=0 if active43!=1

gen inactive43=.
replace inactive43=1 if post_dis <= 43 & active43!=1
replace inactive43=0 if inactive43!=1

replace inactive43=0 if active43==1 

//44

gen active44=.
replace active44=1 if pre_dis <= 44
replace active44=0 if active44!=1

gen inactive44=.
replace inactive44=1 if post_dis <= 44 & active44!=1
replace inactive44=0 if inactive44!=1

replace inactive44=0 if active44==1 

//45
gen active45=.
replace active45=1 if pre_dis <= 45
replace active45=0 if active45!=1

gen inactive45=.
replace inactive45=1 if post_dis <= 45 & active45!=1
replace inactive45=0 if inactive45!=1

replace inactive45=0 if active45==1 

//46
gen active46=.
replace active46=1 if pre_dis <= 46
replace active46=0 if active46!=1

gen inactive46=.
replace inactive46=1 if post_dis <= 46 & active46!=1
replace inactive46=0 if inactive46!=1

replace inactive46=0 if active46==1 

//47
gen active47=.
replace active47=1 if pre_dis <= 47
replace active47=0 if active47!=1

gen inactive47=.
replace inactive47=1 if post_dis <= 47 & active47!=1
replace inactive47=0 if inactive47!=1

replace inactive47=0 if active47==1 

//48
gen active48=.
replace active48=1 if pre_dis <= 48
replace active48=0 if active48!=1

gen inactive48=.
replace inactive48=1 if post_dis <= 48 & active48!=1
replace inactive48=0 if inactive48!=1

replace inactive48=0 if active48==1 

//49

gen active49=.
replace active49=1 if pre_dis <= 49
replace active49=0 if active49!=1

gen inactive49=.
replace inactive49=1 if post_dis <= 49 & active49!=1
replace inactive49=0 if inactive49!=1

replace inactive49=0 if active49==1 

//50
gen active50=.
replace active50=1 if pre_dis <= 50
replace active50=0 if active50!=1

gen inactive50=.
replace inactive50=1 if post_dis <= 50 & active50!=1
replace inactive50=0 if inactive50!=1

replace inactive50=0 if active50==1 

*These varibales aleady defined in the dataset

gen sum_activeinactive20 = active20+inactive20 	
gen sum_activeinactive21 = active21+inactive21 	
gen sum_activeinactive22 = active22+inactive22 	
gen sum_activeinactive23 = active23+inactive23 	
gen sum_activeinactive24 = active24+inactive24 	
gen sum_activeinactive25 = active25+inactive25 	
gen sum_activeinactive26 = active26+inactive26 	
gen sum_activeinactive27 = active27+inactive27 	
gen sum_activeinactive28 = active28+inactive28 	
gen sum_activeinactive29 = active29+inactive29 	
gen sum_activeinactive30 = active30+inactive30 	
gen sum_activeinactive31 = active31+inactive31 	
gen sum_activeinactive32 = active32+inactive32 	
gen sum_activeinactive33 = active33+inactive33 	
gen sum_activeinactive34 = active34+inactive34 	
gen sum_activeinactive35 = active35+inactive35 	
gen sum_activeinactive36 = active36+inactive36 	
gen sum_activeinactive37 = active37+inactive37 	
gen sum_activeinactive38 = active38+inactive38 	
gen sum_activeinactive39 = active39+inactive39 	
gen sum_activeinactive40 = active40+inactive40 	
gen sum_activeinactive41 = active41+inactive41 	
gen sum_activeinactive42 = active42+inactive42 	
gen sum_activeinactive43 = active43+inactive43 	
gen sum_activeinactive44 = active44+inactive44 	
gen sum_activeinactive45 = active45+inactive45 	
gen sum_activeinactive46 = active46+inactive46 	
gen sum_activeinactive47 = active47+inactive47 	
gen sum_activeinactive48 = active48+inactive48 	
gen sum_activeinactive49 = active49+inactive49 	
gen sum_activeinactive50 = active50+inactive50 

gen diffhelp20 = active20
gen diffhelp21 = active21
gen diffhelp22 = active22
gen diffhelp23 = active23
gen diffhelp24 = active24
gen diffhelp25 = active25
gen diffhelp26 = active26
gen diffhelp27 = active27
gen diffhelp28 = active28
gen diffhelp29 = active29
gen diffhelp30 = active30
gen diffhelp31 = active31
gen diffhelp32 = active32
gen diffhelp33 = active33
gen diffhelp34 = active34
gen diffhelp35 = active35
gen diffhelp36 = active36
gen diffhelp37 = active37
gen diffhelp38 = active38
gen diffhelp39 = active39
gen diffhelp40 = active40
gen diffhelp41 = active41
gen diffhelp42 = active42
gen diffhelp43 = active43
gen diffhelp44 = active44
gen diffhelp45 = active45
gen diffhelp46 = active46
gen diffhelp47 = active47
gen diffhelp48 = active48
gen diffhelp49 = active49
gen diffhelp50 = active50



gen helpvar20 = diffhelp20						
	label var helpvar20 "20 km"
gen helpvar21 = diffhelp21						
	label var helpvar21 "21 km"
gen helpvar22 = diffhelp22						
	label var helpvar22 "22 km"
gen helpvar23 = diffhelp23						
	label var helpvar23 "23 km"
gen helpvar24 = diffhelp24						
	label var helpvar24 "24 km"
gen helpvar25 = diffhelp25						
	label var helpvar25 "25 km"
gen helpvar26 = diffhelp26						
	label var helpvar26 "26 km"
gen helpvar27 = diffhelp27						
	label var helpvar27 "27 km"
gen helpvar28 = diffhelp28						
	label var helpvar28 "28 km"
gen helpvar29 = diffhelp29						
	label var helpvar29 "29 km"
gen helpvar30 = diffhelp30						
	label var helpvar30 "30 km"
gen helpvar31 = diffhelp31						
	label var helpvar31 "31 km"
gen helpvar32 = diffhelp32						
	label var helpvar32 "32 km"
gen helpvar33 = diffhelp33						
	label var helpvar33 "33 km"
gen helpvar34 = diffhelp34						
	label var helpvar34 "34 km"
gen helpvar35 = diffhelp35						
	label var helpvar35 "35 km"
gen helpvar36 = diffhelp36						
	label var helpvar36 "36 km"
gen helpvar37 = diffhelp37						
	label var helpvar37 "37 km"
gen helpvar38 = diffhelp38						
	label var helpvar38 "38 km"
gen helpvar39 = diffhelp39						
	label var helpvar39 "39 km"
gen helpvar40 = diffhelp40						
	label var helpvar40 "40 km"
gen helpvar41 = diffhelp41						
	label var helpvar41 "41 km"
gen helpvar42 = diffhelp42						
	label var helpvar42 "42 km"
gen helpvar43 = diffhelp43						
	label var helpvar43 "43 km"
gen helpvar44 = diffhelp44						
	label var helpvar44 "44 km"
gen helpvar45 = diffhelp45						
	label var helpvar45 "45 km"
gen helpvar46 = diffhelp46						
	label var helpvar46 "46 km"
gen helpvar47 = diffhelp47						
	label var helpvar47 "47 km"
gen helpvar48 = diffhelp48						
	label var helpvar48 "48 km"
gen helpvar49 = diffhelp49						
	label var helpvar49 "49 km"
gen helpvar50 = diffhelp50						
	label var helpvar50 "50 km"
	
***Run the following regressions before plotting 
	
*20
reg experts_dummy sum_activeinactive20 helpvar20 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e20
*21
reg experts_dummy sum_activeinactive21 helpvar21 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e21
*22
reg experts_dummy sum_activeinactive22 helpvar22 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e22
*23
reg experts_dummy sum_activeinactive23 helpvar23 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e23
*24
reg experts_dummy sum_activeinactive24 helpvar24 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e24
*25
reg experts_dummy sum_activeinactive25 helpvar25 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e25
*26
reg experts_dummy sum_activeinactive26 helpvar26 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e26
*27
reg experts_dummy sum_activeinactive27 helpvar27 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e27
*28
reg experts_dummy sum_activeinactive28 helpvar28 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e28
*29
reg experts_dummy sum_activeinactive29 helpvar29 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e29
*30
reg experts_dummy sum_activeinactive30 helpvar30 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e30
*31
reg experts_dummy sum_activeinactive31 helpvar31 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e31
*32
reg experts_dummy sum_activeinactive32 helpvar32 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e32
*33
reg experts_dummy sum_activeinactive33 helpvar33 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e33
*34
reg experts_dummy sum_activeinactive34 helpvar34 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e34
*35
reg experts_dummy sum_activeinactive35 helpvar35 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e35
*36
reg experts_dummy sum_activeinactive36 helpvar36 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e36
*37
reg experts_dummy sum_activeinactive37 helpvar37 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e37
*38
reg experts_dummy sum_activeinactive38 helpvar38 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e38
*39
reg experts_dummy sum_activeinactive39 helpvar39 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e39
*40
reg experts_dummy sum_activeinactive40 helpvar40 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e40
*41
reg experts_dummy sum_activeinactive41 helpvar41 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e41
*42
reg experts_dummy sum_activeinactive42 helpvar42 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e42
*43
reg experts_dummy sum_activeinactive43 helpvar43 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e43
*44
reg experts_dummy sum_activeinactive44 helpvar44 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e44
*45
reg experts_dummy sum_activeinactive45 helpvar45 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e45
*46
reg experts_dummy sum_activeinactive46 helpvar46 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e46
*47
reg experts_dummy sum_activeinactive47 helpvar47 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e47
*48
reg experts_dummy sum_activeinactive48 helpvar48 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e48
*49
reg experts_dummy sum_activeinactive49 helpvar49 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e49

*50
reg experts_dummy sum_activeinactive50 helpvar50 age gender education urban capdist bdist3 nlights_calib_mean excluded oil diamond gold i.region i.year  ,vce(cluster geome_id)
	estimates store e50
	
*Plot the figure. And  the figrue has been edited in Stata

set scheme  plottig

coefplot e20 e21 e22 e23 e24  e25 e26  e27 e28  e29 e30 e31 e32 e33 e34 e35 e36 e37 e38 e39 e40 e41 e42 e43 e44 e45 e46 e47 e48 e49 e50 ///
, nooffsets keep(helpvar*) xline(0)  xtitle(Difference) levels(90) msymbol(circle) msize(V small) mcolor(black) lcolor(black)  mfcolor(black) ciopts(recast(rcap))
			

***FIGURE C.2: Chinese Aid projects to the 16 African countries, 1956-2017. 
***********************************************************************************

use "/Users/huangzhenqian/Desktop/Replication data/Chinese aid to africa 1956 2017.dta",clear

* gen a variable r2, cocded as 1 countries which Round 2 surveys covered, coded as 0 otherwise.  
* R2 countries list see  Table 1 in the main text 

line aid_year_r2 year,sort // edited the figure in Stata 




















	
